#!/bin/sh

readonly GUILD_SERVICE_ROOT=$(pwd)/../..
readonly SERVICE_BOX_ROOT=$GUILD_SERVICE_ROOT/../../../..


cp ../../../../lib/stub/guildservicebasic/GuildServiceBasic/libGuildServiceBasic.so ../../../../../../publish/bin/service/

cp ../../../../lib/stub/guildservicequery/GuildServiceQuery/libGuildServiceQuery.so ../../../../../../publish/bin/service/

cp ../../../../lib/stub/guildservicewelfare/GuildServiceWelfare/libGuildServiceWelfare.so ../../../../../../publish/bin/service/

cp ../../../../lib/stub/guildserviceauth/GuildServiceAuth/libGuildServiceAuth.so ../../../../../../publish/bin/service/

cp ../../../../lib/stub/guildservicetimer/GuildServiceTimer/libGuildServiceTimer.so ../../../../../../publish/bin/service/

echo "-- cp so sucess"

cp -rf ../../publish/config/linux/*  $SERVICE_BOX_ROOT/publish/config

pushd .

cd $SERVICE_BOX_ROOT/publish/bin
python pub.py -c ../config/box-guild-service-basic.json
python pub.py -c ../config/box-guild-service-query.json
python pub.py -c ../config/box-guild-service-welfare.json
python pub.py -c ../config/box-guild-service-auth.json
python pub.py -c ../config/box-guild-service-timer.json

popd